﻿using System;
using System.Runtime.Serialization;

namespace Common
{
    [DataContract]
    public class CheckedArticle : HsePSObject
    {
        public CheckedArticle()
        {
            ID = Guid.NewGuid().ToString();
            CreationTime = DateTime.Now;
            Decision = ReviewDecision.NotTakenYet;
        }

        [DataMember]
        public string ID { get; private set; }
        [DataMember]
        public DateTime CreationTime { get; private set; }
        [DataMember]
        public DateTime ModificationTime { get; private set; }
        [DataMember]
        public string EditorID { get; set; }
        [DataMember]
        public string ArticleID { get; set; }
        [DataMember]
        public bool IsVerified { get; set; }
        [DataMember]
        public ReviewDecision Decision
        {
            get { return (ReviewDecision)decisionNumber; }
            set 
            {
                ModificationTime = DateTime.Now;
                decisionNumber = (int)value; 
            }
        }
        public int decisionNumber { get; private set; }
    }
}